<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
 <%@ include file="/common/query.jsp"%>
<%@ include file="/common/det.jsp"%>
<script>
        $(function(){
            var viewType = getQueryStringByDecode("viewType");
            if(viewType==null){
                viewType = 0;
			}
            if(viewType==0){
                init();
			}else if(viewType==1){
				init1();
			}
        });
        function init(){
            var columns = [
                {field:'id',title:'id',hidden:true},
                {field:'pid',title:'pid',hidden:true},
                {field:'name',title:'名称'},
                {field:'enName',title:'英文名称'},
                {field:'code',title:'编码',rowHidden:true},
                {field:'orderBy',title:'排序',type:"number",defaultValue:0,rowHidden:true},
                {field:'remark',title:'备注',rowHidden:true},
                {field:'type',title:'类别',rowHidden:true,
                    input:{type:'radio',value : [{text:'部门',value:10,isDefault:true},{text:'小组',value : 20}]}
                },
                {field:'isDataSharing',title:'同级数据共享',rowHidden:true,
                    input:{type:'radio',value : [{text:'否',value:0,isDefault:true},{text:'是',value : 1}]}
                },
				{field:'isCampus',title:'是否校区',width:20,
                    input:{type:'radio',value : [{text:'',value:0,isDefault:true},{text:'是',value : 1}]}
                }
            ];
            var tree = {
                pid:'pid',
                id : 'id',
                tpid:'0',
                treeField:'name',
                sort:'xuhao'
            };
            url='/system/organization/manager?';
            createQuery('body',columns,{pager:false,edit:true,add:true,searchBar:{hidden:true},del:true,tree:tree,heji:false,singleSelect:true},url);
        }
        function init1() {
            var columns = [
                {field:'id',title:'id',hidden:true},
                {field:'name',title:'名称'},
                {field:'enName',title:'英文名称',width:50},
                {field:'isDataSharing',title:'同级数据共享',width:20,
                    input:{type:'radio',value : [{text:'',value:0,isDefault:true},{text:'是',value : 1}]}
                },
                {field:'isCampus',title:'是否校区',width:20,
                    input:{type:'radio',value : [{text:'',value:0,isDefault:true},{text:'是',value : 1}]}
                }
            ];
            var tree = {
                pid:'pid',
                id : 'id',
                tpid:'0',
                treeField:'name',
                sort:'xuhao'
            };
            url='/system/organization/manager?';
            createQuery('body',columns,{pager:false,edit:false,add:false,searchBar:{hidden:true},editBtn:false,del:false,tree:tree,heji:false,singleSelect:true,
				cb:false,
				onClickRow:function () {
                	var row = getGridChecked()[0];
                	window.parent.seeUser(row);
                }
			}
				,url);
        }

</script>
</head>
<body>
	  <div id="body"></div>
</body>
</html>